*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #000;
    /* 视距：让元素看起来更有 3D 效果 */
    perspective: 900px;
}

section {
    position: relative;
    width: 300px;
    height: 200px;
    cursor: pointer;
    /* 让子元素保留其 3D 位置 */
    transform-style: preserve-3d;
    animation: rotate 20s linear infinite;
}

section:hover {
    animation-play-state: paused;
}

section div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-align: center;
    /*
    设置元素的倒影效果
    below倒影效果在元素下方
    15px是元素和倒影的距离
    后面的属性和背景渐变色是一个属性，设置了一个从下到上由背景透明色过渡到设置了不透明的鼻塞
    */
    -webkit-box-reflect: below 15px -webkit-linear-gradient(transparent 10%, rgba(255, 255, 255, .3));
}

section div:nth-child(1) {
    transform: translateZ(300px);
    background-color: #c14c39;
}

section div:nth-child(2) {
    transform: rotateY(60deg) translateZ(300px);
    background-color: #6e9c72;
}

section div:nth-child(3) {
    transform: rotateY(120deg) translateZ(300px);
    background-color: #5e5f7a;
}

section div:nth-child(4) {
    transform: rotateY(180deg) translateZ(300px);
    background-color: #f5eb98;
}

section div:nth-child(5) {
    transform: rotateY(240deg) translateZ(300px);
    background-color: #50acbc;
}

section div:nth-child(6) {
    transform: rotateY(300deg) translateZ(300px);
    background-color: #f9a99a;
}

/* 定义旋转动画 */
@keyframes rotate {
    0% {
        transform: rotateY(0);
    }
    100% {
        transform: rotateY(360deg);
    }
}
